<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title></title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../static/userinfoPrivate/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="../static/userinfoPrivate/css/thesame.css" media="all">
	<link rel="stylesheet" href="../static/userinfoPrivate/css/headCss.css" media="all">
	<link rel="stylesheet" href="../static/userinfoPrivate/css/leftSidebar.css" media="all">
	<link rel="stylesheet" href="../static/userinfoPrivate/userinfo/css/rightCon.css" media="all">
	<link rel="stylesheet" href="../static/userinfoPrivate/userinfo/css/tree.css" media="all">
	<link rel="stylesheet" href="../static/userinfoPrivate/userinfo/css/page.css" media="all">
	<link rel="stylesheet" href="../static/userinfoPrivate/userinfo/css/popCss.css" media="all">
</head>
<style type="text/css">
	.pop-form-span .layui-input-block > .layui-btn{ height: 36px; line-height: 36px; float: left }
	.pop-form-span .layui-input-block .layui-upload-choose {
	    padding: 0 10px;
	    color: #999;
	    background-color: transparent;
	}
	.add-mess-child > div:nth-child(1) {
	    width: 49px;
	    text-align: left;
	}
</style>

<script>  
	var isCURD=false;
</script>
<shiro:hasPermission name="danganguanli_cud">
  	<script>
  		isCURD =true;
  	</script> 
</shiro:hasPermission>


<body class="layui-layout-body">
	<div class="layui-body pad12px">
		<!-- 内容主体区域 -->
		<div class="layui-box-con relative">
			<div class="layui-left-con pad12px">
				<div class="border-radius4 bgWhite box-shadows">
					<!-- <div id="test13" class="layui-left-box"></div> -->
					<div class="tree-con-box" id="organizationDiv">
						
					</div>
				</div>
			</div>
			<div class="layui-right-con">
				<div class="layui-tab">
					<ul class="layui-tab-title">
						<li class="layui-this">全部</li>
						<!-- <li onclick="jumpUserInfoListOfDeath()">健在老人离世老人</li> -->
					</ul>
					<div class="layui-tab-content layui-right-box bgWhite box-shadows border-radius4">
						<div class="layui-tab-item layui-show">
							<div class="pad20px">
								<nav class="layui-form more-date">
									<ul>
										<!-- <li>
											<div>户籍</div> 
											<div> 
												<p><input type="radio" name="householdRegister" value="" title="全部" checked></p>
												<p  th:each="list:${householdRegisterList}">
													<input type="radio" name="householdRegister" th:value="${list.labelCode}" th:title="${list.labelName}">
												</p>
											</div>
										</li> -->
										<li>
											<div>户籍所在地</div>
											<div>
												<p><input type="radio" name="location" value="" title="全部" checked></p>
												<p  th:each="list:${locationList}">
													<input type="radio" name="location" th:value="${list.labelCode}" th:title="${list.labelName}">
												</p>
											</div>
										</li>
										<li>
											<div>常住人口</div>
											<div>
												<p><input type="radio" name="isLongStay" value="" title="全部" checked></p>
												<p><input type="radio" name="isLongStay" value="1" title="是"></p>
												<p><input type="radio" name="isLongStay" value="2" title="否"></p>
						
											</div>
										</li>
										<li>
											<div>年龄段</div>
											<!-- <div>
												<p><input type="radio" name="age" value="" title="全部" checked></p>
												<p><input type="radio" name="age" value="1" title="60岁以下"></p>
												<p><input type="radio" name="age" value="2" title="60-69岁"></p>
												<p><input type="radio" name="age" value="3" title="70-79岁"></p>
												<p><input type="radio" name="age" value="6" title="80-89岁"></p>
												<p><input type="radio" name="age" value="4" title="90-99岁"></p>
												<p><input type="radio" name="age" value="5" title="100岁及以上"></p>
						
											</div> -->
											<div class="time-con"> 

												<p>
													<span class="left"><input type="number" placeholder="最小年龄" id="startAge"  min="1"  max="999"  class="layui-input" style="margin-top: 4px;width: 90px"></span> 
													<span class="left">&nbsp;-&nbsp;</span>
													<span class="left"><input type="number" placeholder="最大年龄" id="endAge" min="1" max="999"  class="layui-input" style="margin-top: 4px;width: 90px"></span> 
												</p>
											</div>
										</li>
										<li>
											<div>性别</div>
											<div>
												<p><input type="radio" name="userSex" value="" title="全部" checked></p>
												<p><input type="radio" name="userSex" value="1" title="男"></p>
												<p><input type="radio" name="userSex" value="2" title="女"></p>
						
											</div>
										</li>
										<li>
											<div>目前养老状况</div>
											<div>
												<p><input type="radio"  name="pensionStatus" value="" title="全部" checked></p>
												<p  th:each="list:${pensionStatusList}">
													<input type="radio" name="pensionStatus" th:value="${list.labelCode}" th:title="${list.labelName}">
												</p>
											</div>
										</li> 
										<li>
											<div>政治面貌</div>
											<div>
												<p><input type="checkbox" lay-filter="politicalFilter"  name="political" value="" lay-skin="primary" title="全部" checked=""></p>
												<p  th:each="list:${politicalList}"><input type="checkbox" lay-filter="politicalFilter" name="political"  th:value="${list.labelCode}"  lay-skin="primary" th:title="${list.labelName}">
												</p>
											</div>
										</li>

										<li>
											<div>社保类型</div>  
											<div>
												<p><input type="checkbox" name="socialSecurity" lay-filter="socialSecurityFilter" value="" lay-skin="primary" title="全部" checked=""></p>
												<p  th:each="list:${socialSecurityList}"><input type="checkbox" lay-filter="socialSecurityFilter" name="socialSecurity"  th:value="${list.labelCode}"  lay-skin="primary" th:title="${list.labelName}">
												</p>
											</div>
										</li>
										<li>
											<div>居家状况</div>
											<div>
												<p><input type="checkbox" lay-filter="liveHomeStatusFilter"  name="liveHomeStatus" value="" lay-skin="primary" title="全部" checked=""></p>
												<p  th:each="list:${liveHomeStatusList}"><input type="checkbox" name="liveHomeStatus" lay-filter="liveHomeStatusFilter"  th:value="${list.labelCode}"  lay-skin="primary" th:title="${list.labelName}">
												</p>
											</div>
										</li>

										<li>
											<div>照顾人群</div> 
											<div>
												<p><input type="checkbox" lay-filter="careCrowdFilter"  name="careCrowd"  value="" lay-skin="primary" title="全部" checked=""></p>
												<p  th:each="list:${careCrowdList}">
													<input type="checkbox" name="careCrowd" lay-filter="careCrowdFilter" th:value="${list.labelCode}"  lay-skin="primary" th:title="${list.labelName}">
												</p>
											</div>
										</li>


										<li>
											<div>老人姓名</div> 
											<div>
												<p><input type="text" id="searchContent" class="layui-input" style="width: 300px; margin-top: 4px;" placeholder="请输入老人姓名进行搜索"></p>
											</div>
										</li>


									</ul>
									<div class="pt15px pb15px textRight">
										<p class="layui-btn" onclick="query()">查&nbsp;询</p>
										<p class="layui-btn layui-btn-primary"  onclick="reset()">重&nbsp;置</p>
										<p class="green cursor right lh32px ml25px btn-select"><span>展开</span><img src="../static/userinfoPrivate/userinfo/img/select_icon_down.png" class="ml10px"></p>
									</div>
								</nav>
								<div class="more-table-con relative">
									<div class="mt20px mb20px lh32px overflow add-btn-input">
										<p class="left cursor">


											<!-- <shiro:hasPermission name="danganguanli_cud">
											  	<span onclick="jumpUserInfoAdd()" class="white border-radius4 bgGreen inline-block pl15px pr15px">
													<img src="../static/userinfoPrivate/userinfo/img/button_add.png">新建档案
												</span>
											</shiro:hasPermission> -->
											<!-- <span onclick="layerOpenOfImport()"  class="white border-radius4 bgGreen inline-block pl15px pr15px ml25px">
												<img src="../static/userinfoPrivate/userinfo/img/button_dr.png">批量导入
											</span> -->
										</p>
										<!-- <p class="right">
											<input type="text" id="searchContent" class="layui-input" placeholder="请输入老人姓名进行搜索">
											<span>
												<img src="../static/userinfoPrivate/userinfo/img/icon_search.png">
											</span>
										</p> -->
									</div>
									<!-- <div class="layui-tab"  lay-filter="liveConditionFilter"> -->
										<!-- <ul id="liveCondition"  class="layui-tab-title"> 
											<li  class="layui-this" value="1">户在人在</li>
											<li value="3">户在人不在</li>
											<li value="2">人在户不在</li>
										</ul> -->
										<div class="layui-tab-content padding0">
											<div class="layui-tab-item layui-show relative border1px">
												<table class="layui-hide" id="test" lay-filter="test">
													
												</table>
												<div class="number-page">
													共有<span class="red" id="totalNum">0</span>条数据
												</div>
											</div>
											<!-- <div class="layui-tab-item">内容2</div>
											<div class="layui-tab-item">内容3</div>
											<div class="layui-tab-item">内容4</div>
											<div class="layui-tab-item">内容5</div> -->
										<!-- </div> -->
									</div>
								<!-- </div> -->
							</div>
						</div>
						<!-- <div class="layui-tab-item">内容2</div>
						<div class="layui-tab-item">内容3</div> -->
					</div>
				</div>
				
			</div>
		</div>

	</div>



	<div id="pop-con" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">导入老人信息档案</span>
					<p class="right"><img src="../static/userinfoPrivate/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="pop-form pop-form-span mt30px mb30px">
					<div class="layui-form-item">
						<label class="layui-form-label">导入文件</label>
						<div class="layui-input-block">
							<button type="button" class="layui-btn layui-btn-normal" id="choseFileButton">选择文件</button>
							<!-- <span onclick="importFileClick()">选&nbsp;择</span> -->
							<!-- <span id="fileName"></span> -->
						</div>
						<!-- <input type="file" style="display:none" name="file" id="uploadFile"/> -->
					</div>
					<div class="layui-form-item">
				       	<label class="layui-form-label">导入模板</label>
				       	<div class="layui-input-block ">
					        <span  class="current" onclick="importTempleFile()">下载导入模板</span>
					    </div> 
				    </div>
					<div class="layui-form-item">
				       	<label class="layui-form-label">导入规则</label>
				       	<div class="layui-input-block layui-input-block-two">
					        <span value="1" class="current">只导增量</span>
					        <span value="2">覆盖原有数据</span>
				       	</div> 
				    </div>
				</div>
				<div class="btn-con textCenter">
					<span class="btn-one cursor" onclick="cancel()">取&nbsp;消</span>
					<span class="btn-two cursor"  id="confirmButton" >提&nbsp;交</span>
				</div>
			</div>
		</div>
	</div>



<script src="../static/userinfoPrivate/js/jquery-2.1.3.min.js"></script>
<script src="../static/userinfoPrivate/layui/layui.js" charset="utf-8"></script>
<!-- <script src="../static/userinfoPrivate/userinfo/js/treeTwo.js"></script> -->
<script src="../static/userinfoPrivate/userinfo/js/treeThree.js"></script>
<script>

	$(function(){
		$('div.layui-input-block-two span').click(function(){
	    	$(this).addClass('current').siblings().removeClass('current');
	   	});
		$('.tab-con-cur li').click(function() {
			$(this).addClass('current').siblings().removeClass('current');
		})
		$('.more-date li:gt(3)').hide();
		$('.btn-select').click(function() {
			if ($(this).find('img').attr('src') == '../static/userinfoPrivate/userinfo/img/select_icon_up.png') {
				$(this).find('img').attr('src', '../static/userinfoPrivate/userinfo/img/select_icon_down.png').siblings("span").text("展开");
			} else {
				$(this).find('img').attr('src', '../static/userinfoPrivate/userinfo/img/select_icon_up.png').siblings("span").text("收起");
			}
			$('.more-date li:gt(3)').slideToggle(300);
		})



		


		//分页查询
		var liveCondition =$("#liveCondition li.layui-this").val();
		query(liveCondition);



		//导入文件
		layui.use('upload', function(){
			var upload = layui.upload;
			//选完文件后不自动上传
		  	upload.render({
		    	elem: '#choseFileButton'
		    	,url: '../userInfo/importReport' //改成您自己的上传接口
		    	,before: function(obj){ //obj参数包含的信息，跟 choose回调完全一致，可参见上文。
				    layer.load(); //上传loading
				}
		    	,auto: false
		    	,accept: 'file'
		    	,bindAction: '#confirmButton'
		    	,exts:'xls|xlsx'
		    	,data:{
		    		//增加或者覆盖 1-增加 2-覆盖
		    		addOrCover:function(){
		    			// console.log($(".layui-input-block-two .current").attr("value"));
		    			return $(".layui-input-block-two .current").attr("value");
		    		}
		    		,orgId:function(){
		    			return overAllOrgId;
		    		}
		    	}
		    	,done: function(res){
		    		if (res.code==200) {
		    			layer.closeAll();
		    			layer.msg('上传成功,'+res.msg, {icon: 1});
		    		}else{
		    			layer.closeAll();
		    			layer.msg(res.msg, {icon: 2});
		    		}
		    	}
		  	});
		})


		//获取组织架构
		getOrganization();

		//选项卡监听
		layui.use('element', function(){
		  var element = layui.element;
		  element.on('tab(liveConditionFilter)', function(data){
		     // console.log(data.elem.context.value);
		    query(data.elem.context.value);

		  });
		});

		//照顾人群
		CheckBoxChange('careCrowdFilter','careCrowd');
		//居家状况
		CheckBoxChange('liveHomeStatusFilter','liveHomeStatus');
		//社保类型
		CheckBoxChange('socialSecurityFilter','socialSecurity');
		//政治面貌
		CheckBoxChange('politicalFilter','political');

	})



	function CheckBoxChange(filterName,checkName){

		layui.use('form', function() {
			var form = layui.form; 
			form.render();
			form.on('checkbox('+filterName+')', function(obj){
				// console.log(obj.elem);
				// console.log(obj.elem.value);
				// console.log(obj.elem.checked);
				if(!isNull(obj.elem.value)){　　　　　　
					$("input[name='"+checkName+"']").eq(0).prop("checked", false);

					var allFalse = false;
					$("input[name='"+checkName+"']:checked").each(function(i){
						allFalse=$(this).is(":checked");
					})
					if (!allFalse) {
						$("input[name='"+checkName+"']").eq(0).prop("checked", true);
					}
			    }else{
			    	
			    	$("input[name='"+checkName+"']:checked").each(function(i){
						if (!isNull($(this).val())) {
							$(this).prop("checked", false);
						}
					})
			    }
			    form.render("checkbox");
			});
		});

	}


	//跳转离世老人列表
	function jumpUserInfoListOfDeath(){
		window.location.href="../userInfo/jumpUserInfoListOfDeath";
	}


	//新增档案
	function jumpUserInfoAdd(){
		window.location.href="../userInfo/jumpUserInfoAdd";
	}


	//批量导入
	// function batchImport(){

	// }

	//取消
	function cancel(){
		layer.closeAll();
	}


	//重置
	function reset(){
		$("input[name='householdRegister']").eq(0).prop("checked",true);//户籍
		$("input[name='location']").eq(0).prop("checked",true); //所在地区
		$("input[name='age']").eq(0).prop("checked",true);//年龄段
		$("input[name='userSex']").eq(0).prop("checked",true); //性别
		$("input[name='pensionStatus']").eq(0).prop("checked",true); //目前养老状况
		$("input[name='isLongStay']").eq(0).prop("checked",true); //常住人口



		resetCheckBox("political");//政治面貌
		resetCheckBox("socialSecurity");//社保类型
		resetCheckBox("liveHomeStatus");//居家状况
		resetCheckBox("careCrowd");//照顾人群
		resetCheckBox("political");//政治面貌
		$("#searchContent").val("");//关键字
		
		layui.form.render();//***
	}

	function resetCheckBox(name){
		$("input[name='"+name+"']").each(function(i){
			if (isNull($(this).val())) {
				$(this).prop("checked",true);
			}else{
				$(this).prop("checked",false);
			}
		})


	}

	//查询
	function query(liveCondition){

		//console.log("=============="+overAllOrgId);

		//左侧菜单栏
		layui.use(['table'], function() {
			var table = layui.table;
			
			//第一个实例
			table.render({
				elem: '#test'//,url: '/demo/table/user/'
				,url:"../userInfo/getUserInfoSynthesizePageList"
				,where: getformDate(liveCondition,overAllOrgId)
				,request: {
					 pageName: 'currentPage' //页码的参数名称，默认：page
					 ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
				}
				//,count: 10  //数据总数，从服务端得到
				//,data: listData
				,page: true //开启分页
				,limit:10 //每页显示的条数
				//,limits:[3,4,5]
				,groups: 9 //连续页码个数
				,parseData:function(res){
					return{
						"code":res.code,
						"data":res.data.data,
						"count":res.data.totalCount,
						"limit":res.data.pageSize,
					};
				}
				,cols: [
					[ //表头
						{
							field: 'userNo',
							title: '序号',
							fixed: 'left',
							type: 'numbers',
						}, {
							field: 'userName',
							title: '姓名',
						}, {
							field: 'userSex',
							title: '性别',
						}, {
							field: 'age',
							title: '年龄',
						}, 
						{
							field: 'isLongStay',
							title: '常住人口',
						},
						 {
							field: 'location',
							title: '户籍所在地',
						}, {
							field: 'liveAddress',
							title: '现居住地址',
						}, {
							field: 'belongOrganization',
							title: '管辖行政区',
						}

						// ,{
						// 	field: 'operation',
						// 	title: '操作',
						// 	style: 'color:#1C9399;',
						// 	fixed: 'right',
						// 	templet: function(res){

						// 		if (isCURD) {
						// 			return '<div class="table-list-btn"><span class="cursor" onclick="getdetail(\''+res.userNo+'\')">查看</span>|<span class="cursor"  onclick="editUserInfo(\''+res.userNo+'\')">编辑</span>|<span class="cursor"   onclick="deleteUserInfo(\''+res.userNo+'\')">删除</span></div>';
						// 		}else{
						// 			return '<div class="table-list-btn" style="color: #eee;"><span class="cursor" onclick="getdetail(\''+res.userNo+'\')">查看</span>|<span  style="color: #eee;class="cursor">编辑</span> | <span  style="color: #eee;class="cursor">删除</span></div>';
						// 		}

								
						// 	}
						// }
					]
				]
				,done:function(res, curr, count){
				    $("#totalNum").text(count);
				}
			});
		});
	}

	//导入模板
	function importTempleFile(){
		window.location.href="../userInfo/getUserInfoReportTemplate";
	}


	//查看
	function getdetail(userNo){
		// console.log("查看--"+userNo);
		window.location.href="../userInfo/jumpUserInfoDetail?userNo="+userNo;
	}
	//编辑
	function editUserInfo(userNo){
		window.location.href="../userInfo/jumpUserInfoUpdate?userNo="+userNo;
	}
	//删除
	function deleteUserInfo(userNo){
		// console.log("删除--"+userNo);
		layer.confirm('确定要删除档案么？', {
		  btn: ['确定', '取消'] //可以无限个按钮
		}, function(index, layero){
		  	del(userNo);
		}, function(index){
		  
		});
	}

	//删除
	function del(userNo){
		var formDate =
        {
            userNo: userNo
        };

		$.ajax({
            url: "../userInfo/deleteUserInfoByUserNo",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {	
                if (res.code == "200") {
                	layer.msg('删除成功', {icon: 1,time:1500},function(){
                		//删除成功 返回列表页
                		window.location.href="../userInfo/jumpUserInfoList";
                	});
                }else{
                	layer.msg(res.msg, {icon: 2});
                }
            },
        });

	}


	//获取发送的数据
	function getformDate(liveCondition,orgId){
		
		var householdRegister = $("input:radio[name='householdRegister']:checked").val(); //户籍
		var isLongStay = $("input:radio[name='isLongStay']:checked").val(); //常住人口
		var location = $("input:radio[name='location']:checked").val(); //所在地区
		// var age =  $("input:radio[name='age']:checked").val(); //年龄段
		var userSex =  $("input:radio[name='userSex']:checked").val(); //性别
		var pensionStatus =  $("input:radio[name='pensionStatus']:checked").val(); //目前养老状况
		var political = getCheckBoxValue("political");//政治面貌
		var socialSecurity = getCheckBoxValue("socialSecurity");//社保类型
		var liveHomeStatus = getCheckBoxValue("liveHomeStatus");//居家状况
		var careCrowd = getCheckBoxValue("careCrowd");//照顾人群
		var searchContent = $("#searchContent").val();//关键字
		var liveCondition = "";
		if (isNull(liveCondition)) {
			liveCondition = $("#liveCondition .layui-this").val();
		}else{
			liveCondition = liveCondition;
		}

		var startAge =  $("#startAge").val();//开始年龄
		var endAge =  $("#endAge").val();//结束年龄


		
		var formDate ={
			householdRegister : householdRegister,
			isLongStay : isLongStay,
			location : location,
			// age : age,
			startAge : startAge,
			endAge : endAge,
			userSex : userSex,
			pensionStatus : pensionStatus,
			political : political,
			socialSecurity : socialSecurity,
			liveHomeStatus : liveHomeStatus,
			careCrowd : careCrowd,
			searchContent : searchContent,
			liveCondition : liveCondition,
			orgId : orgId
		}
		return formDate;
	}


	//获取checkbox 多选框的值
	function getCheckBoxValue(checkboxId){
		var checkboxValue=""
		$("input[name='"+checkboxId+"']:checked").each(function(i){
			if (isNull(checkboxValue)) {
				checkboxValue+=$(this).val();
			}else{
				checkboxValue+=","+$(this).val();
			}
		})
		return checkboxValue;
	}	


	var overAllOrgId = "";
	function organizationChangeQuery(obj){
		var orgId = $(obj).data("orgid");
		// console.log("organizationChangeQuery = "+orgId );
		overAllOrgId = orgId;
		var liveCondition =$("#liveCondition li.layui-this").val();
		query(liveCondition);
	}


	//获取组织架构
	function getOrganization(){

		var formDate =
            {	
            };

        $.ajax({
            url: "../userInfo/getOrganizationOfMultiple",
            type: "get",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
				 // console.log(res);
                if (res.code == "200") {
					var organizationList = res.data.children;
					var str="";

					var whichFloor = 1;
					var uLHasNum = switchCss(whichFloor);


					str+="<ul class="+uLHasNum+">";
					$.each(organizationList,function(key,rog1){
                		
						str+='<li>';
						str+='<div class="tree-children" >';
						str+='<div>';

						str+="<p class='tree-arrow cursor'><img src='../static/userinfoPrivate/userinfo/img/icon_select_up.png'></p>"
						str+='<p data-orgid="'+rog1.orgId+'" onclick="organizationChangeQuery(this)">'+rog1.orgName+'</p>';
						str+='</div>';
						str+='</div>';
						
						if ( rog1.isChildExist=='1' &&!isNull(rog1.children)  && rog1.children.length>0) {
						str+=splicingMainStr(rog1,whichFloor);
						}
						str+='</li>';
					});
					str+='</ul>';

					$("#organizationDiv").html(str);
					//初始化
					init();
                }else{
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });

	}



	//拼接
	function splicingMainStr(rog1,whichFloor){
		var str = "";
		if(rog1.isChildExist=='1' && !isNull(rog1.children) && rog1.children.length>0){
			whichFloor = whichFloor+1;
			var uLHasNum = switchCss(whichFloor);

			str+='<ul class=" '+uLHasNum+'">';

			$.each(rog1.children,function(key,rog2){
				if(rog2.isChildExist=='1' && !isNull(rog2.children) && rog2.children.length>0){
					str+='<li>';
					str+='<div class="tree-children">';
					str+='<div>';
					str+="<p class='tree-arrow cursor'><img src='../static/userinfoPrivate/userinfo/img/icon_select_up.png'></p>"
					str+='<p data-orgid="'+rog2.orgId+'" onclick="organizationChangeQuery(this)">'+rog2.orgName+'</p>';
					str+='</div>';
					str+='</div>';
					str+=splicingMainStr(rog2,whichFloor);
					str+='</li>';
				}else{
					if(!isNull(rog2)){
						str+=splicingStr(rog2);
					}
				}
			})
			str+='</ul>';

		}else{
			if(!isNull(rog1)){
				str+=splicingStr(rog1);
			}
		}
		return str;
	}



	//拼接
	function splicingStr(org){
		var str ="";
		//是否是行政机构 0-否，1-是    type 是否实际勾选 1-是 0-否
		str+='<li>';
		str+='<div class="tree-children">';
		str+='<div>';
		str+='<p data-orgid="'+org.orgId+'" onclick="organizationChangeQuery(this)">'+org.orgName+'</p>';
		str+='</div>';
		str+='</div>';
		str+='</li>';
		return str;
	}





	//层级转换标签
	function switchCss(whichFloor){

		var uLHasNum = "";

		switch (whichFloor) {
		  case 1:
		    uLHasNum = "tree-one";
		    break;
		  case 2:
		    uLHasNum = "tree-two";
		    break;
		  case 3:
		    uLHasNum = "tree-three";
		    break;
		  case 4:
		    uLHasNum = "tree-four";
		    break;
		  case 5:
		    uLHasNum = "tree-five";
		}
		return uLHasNum;
	}

	function isNull(value) {
		return value == null || value === "" || value === undefined;
	}

	//导入弹层
	function layerOpenOfImport(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ['$("div#pop-con")', ''],
			shade: 0.6,
			id: 'payCons', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-con"),
			success: function() {
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
	
		});
	}

</script>
</body>

</html>
